#lang rosetta-racket


(require "utils.rkt"
         "ysios.rkt")

(provide ysios-wall-1-example
         ysios-wall-2-example
         ysios-wall-3-example
         ysios-wall-4-example)


(define (ysios-wall-1-example)
  (lofted-surface
   (enumerate-m-n
    (λ (x z)
      (xyz x
           (cos x)
           z))
    (* -7 pi) (* 7 pi) 100
    0 5 10)))

(define (ysios-wall-2-example)
  (lofted-surface
   (enumerate-m-n
    (λ (x z)
      (xyz x
           (cos x)
           (* z (+ 1 (* 0.2 (cos x))))))
    (* -7 pi) (* 7 pi) 100
    0 5 10)))

(define (ysios-wall-3-example)
  (lofted-surface
   (enumerate-m-n
    (λ (x z)
      (xyz x
           (* (+ z 3) (cos x))
           (* z (+ 1 (* 0.2 (cos x))))))
    (* -7 pi) (* 7 pi) 100
    0 5 10)))

(define (ysios-wall-4-example)
  (lofted-surface
   (enumerate-m-n
    (λ (x z)
      (+xyz u0
            x
            (if (<= (- pi/2) x pi/2)
                (* (+ z 3) 0.8 (cos x))
                (cos x))
            (if (<= (- pi/2) x pi/2)
                (* z (+ 1 (* 0.4 (cos x))))
                (* z (+ 1 (* 0.2 (cos x)))))))
    (* -7 pi) (* 7 pi) 100
    0 5 10)))

(define (ysios-roof-example)
  (ysios-roof
   (ysios-curve (xyz 0 -20 5.0) 0.0 +1.0 -4.0 +1.0)
   (ysios-curve (xyz 0 -20 5.4) 0.0 +1.0 -6.0 +2.8)
   (ysios-curve (xyz 0 +20 5.0) 0.0 -1.0 +0.0 -1.0)
   (ysios-curve (xyz 0 +20 5.4) 0.0 -1.0 +0.0 -1.0)))

(define (ysios-example)
  (list
   (lofted-surface
    (enumerate-m-n
     (λ (x z)
       (+xyz (xyz (/ (* 14 pi) 100 2) -17 0.2)
             x
             (if (<= (- pi/2) x pi/2)
                 (* (+ z 3) -0.8 (cos x))
                 (- (cos x)))
             (if (<= (- pi/2) x pi/2)
                 (* z (+ 1 (* 0.4 (cos x))))
                 (* z (+ 1 (* 0.2 (cos x)))))))
     (* -7 pi) (* 7 pi) 100
     0 5 10))
   (ysios-roof
    (ysios-curve (xyz 0 -20 5.0) 0.0 +1.0 -4.0 +1.0)
    (ysios-curve (xyz 0 -20 5.4) 0.0 +1.0 -6.0 +2.8)
    (ysios-curve (xyz 0 +20 5.0) 0.0 -1.0 +0.0 -1.0)
    (ysios-curve (xyz 0 +20 5.4) 0.0 -1.0 +0.0 -1.0))))